<?php if (!defined('SHUIPF_VERSION')) exit(); ?>
<Admintemplate file="Common/Head"/>
<body class="J_scroll_fixed">
<script src="/statics/js/common.js"></script>
<link href="/statics/job/js/js/common.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="/statics/job/js/js/jquery.js"></script>
<script type="text/javascript" src="/statics/job/js/js/jquery.QSdialog.js"></script>
<script type="text/javascript" src="/statics/job/js/js/jquery.vtip-min.js"></script>
<script type="text/javascript" src="/statics/job/js/js/jquery.grid.rowSizing.pack.js"></script>
<script type="text/javascript" src="/statics/job/js/js/jquery.validate.min.js"></script>
<!--<script type="text/javascript" src="/statics/job/js/js/common.js"></script>-->
<script type="text/javascript">
    $(document).ready(function()
    {
        //点击批量取消
        $("#ButDel").click(function(){
            if (confirm('你确定要删除吗？'))
            {
                $("form[name=form1]").attr("action","?act=del_category");
                $("form[name=form1]").submit()
            }
        });
        //全选
        $('#chkAll').click(function()
        {
            $("#form1 :checkbox[disabled=false]").attr('checked',$("#chk").attr('checked'));
            setbg();
        });

    });
    //设置label背景
    function setbg()
    {
        $(":checkbox").parent("label").css("color","#666666");
        $(":checkbox[checked]").parent("label").css("color","#009900");
        $(":radio").parent("label").css("color","#666666");
        $(":radio[checked]").parent("label").css("color","#009900");
    }
</script>
<div class="wrap J_check_wrap">
    <Admintemplate file="Common/Nav"/>
    <div class="toptip">
        <h2>提示：</h2>
        <p>
            正式运营后删除分类会导致与此分类关联的信息类别丢失，修改不会受影响。
        </p>
    </div>
    <form id="form1" name="form1" method="post" action="?act=category_save">

        <table width="100%" border="0" cellpadding="0" cellspacing="0" id="list" class="link_lan"  >
            <tr>
                <td height="26" class="admin_list_tit admin_list_first">
                    <label id="chkAll">
                        <input type="checkbox" name=" " title="全选/反选" id="chk"/>{$menu.g_name}
                        <span style="color: #999999; font-size:11px;">({$menu.g_alias})</span>
                    </label>
                </td>
                <td width="30%"   align="center"  class="admin_list_tit">排序</td>
                <td width="30%"   class="admin_list_tit">操作</td>
            </tr>
            <foreach name="data" item="li">

            <tr>
                <td   class="admin_list admin_list_first" >
                    <input type="checkbox" name="id[]" value="{$li.c_id}"   />
                    <input name="c_id[]" type="hidden" value="{$li.c_id}" />
                    <input name="c_name[]" type="text"  value="{$li.c_name}" class="input_text_200"/>
                    <span style="color:#CCCCCC">(id:{$li.c_id})</span>
                </td>
                <td align="center"  class="admin_list">
                    <input name="c_order[]" type="text"  value="{$li.c_order}" class="input_text_50"/>
                </td>
                <td class="admin_list">
                    <a href="{:U('admin/categroy/edit_category')}&id={$li.c_id}">修改</a>
                    &nbsp;&nbsp;
                    <a onclick="return confirm('删除后无法恢复，你确定要删除吗？')" href="{:U('admin/categroy/del_category')}&id={$li.c_id}">删除</a>
                </td>
            </tr>
            </foreach>
        </table>
        <if condition="!$data">
            <div class="admin_list_no_info">此组分类下还没有分类，请添加。</div>
        </if>

        <table width="100%" border="0" cellspacing="10"  class="admin_list_btm">
            <tr>
                <td>
                    <if condition="$data">
                    <input name="ButSave" type="submit" class="admin_submit" id="ButSave" value="保存修改"/>
                    </if>
                    <input name="ButADD" type="button" class="admin_submit" id="ButADD" value="添加分类"  onclick="window.location='{:U(\'admin/categroy/add_category\')}&alias={$menu.g_alias}'"/>
                    <input name="ButDel" type="button" class="admin_submit" id="ButDel"  value="删除所选" />
                    <input name="location" type="button" class="admin_submit"   value="返回分类组" onclick="window.location='{:U(\'admin/categroy/otherlist\')}'" />
                </td>
                <td width="305" align="right">

                </td>
            </tr>
        </table>

</div>



</body>
</html>